//
//  WSqlite.h
//  CPICApp
//
//  Created by sinosoft on 13-4-24.
//  Copyright (c) 2013年 lizhiwei. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "sqlite3.h"

@interface WSqlite : NSObject
{
    const char*filePath;
	NSString*tableName;
	NSString *dataBaseName;
    char*err;
    NSLock *SqlLock;
}
+(WSqlite*)Instance;
-(id)init;
-(BOOL)openSqlite;

-(BOOL)insertServiceType:(NSString *)strServiceType serviceName:(NSString *)strServiceName;
-(BOOL)insertServicePoint:(NSArray *)arrServicePoint;
-(BOOL)insertServicePoint:(NSArray *)arrServicePoint brandCode:(NSString *)strBrandCode;
-(BOOL)CheckHasServiceType:(NSString *)strServiceType;
-(BOOL)deleteServiceType:(NSString *)strServiceType;
-(BOOL)deleteServiceType2:(NSString *)strServiceType withBrand:(NSString *)strBrand;
-(BOOL)deleteServiceType2:(NSString *)strServiceType withBrand:(NSString *)strBrand withId:(NSString *)strId;
-(BOOL)deleteServiceRelacionBrand:(NSString *)strServicePointId withBrand:(NSString *)strBrandCode;
-(NSMutableArray *)getServicePoint;
-(NSMutableArray *)getServiceSpecifyPoint:(NSString *)strServiceType;
-(NSMutableArray *)getServiceSpecifyPoint2:(NSString *)strServiceType withBrand:(NSString *)strBrand;
-(NSMutableArray *)getServiceBrand:(NSString *)strBrandCode;
-(NSMutableArray *)getServiceBrandPoint:(NSString *)strServiceType withBrand:(NSString *)strBrand;


-(BOOL)insertCarList:(NSArray *)arrCarList withUserAccount:(NSString *)userAccount;
-(BOOL)deleteCarList:(NSString *)strCarID withCarName:(NSString *)strCarName withUserAccount:(NSString *)userAccount;
-(NSMutableArray *)getCarList:(NSString *)userAccount;


-(BOOL)insertCarDetail:(NSMutableDictionary *)dictCarDetail withCarID:(NSString *)strCarID withUserAccouont:(NSString *)userAccount;
-(BOOL)deleteCarDetail:(NSString *)strCarID withUserAccount:(NSString *)userAccount;
-(NSMutableDictionary *)getCarDetail:(NSString *)strCarID withUserAccount:(NSString *)userAccount;

-(BOOL)insertPolicyData:(NSMutableArray *)arrInsPolicyList withUserAccount:(NSString *)userAccount withTag:(NSString *)strTag withPlateNo:(NSString *)strPlateNo withCertificateno:(NSString *)strCertificateno;
-(BOOL)deletePolicyData:(NSString *)strPolicyNo withUserAccount:(NSString *)userAccount;
-(NSMutableArray *)getPolictData:(NSString *)userAccount withTag:(NSString *)strTag  withPlateNo:(NSString *)strPlateNo;

-(BOOL)insertPolicyKindData:(NSMutableArray *)arrInsPolicyKindList withUserAccount:(NSString *)userAccount withPolicyNo:(NSString *)strPolicyNo;
-(BOOL)deletePolicyKindData:(NSString *)strPolicyNo withUserAccount:(NSString *)userAccount withSubCoverage:(NSString *)strSubCoverage;
-(NSMutableArray *)getPolictKindData:(NSString *)userAccount withPolicyNo:(NSString *)strPolicyNo;

-(BOOL)insertPolicyMainData:(NSMutableDictionary *)dictPolicyMainData withPolicyNo:(NSString *)strPolicyNo withUserAccouont:(NSString *)userAccount;
-(BOOL)deletePolicyMainData:(NSString *)strPolicyNo withUserAccount:(NSString *)userAccount;
-(NSMutableDictionary *)getPolicyMainData:(NSString *)strPolicyNo withUserAccount:(NSString *)userAccount;

-(BOOL)insertPolicyCarData:(NSMutableDictionary *)dictPolicyCarData withPolicyNo:(NSString *)strPolicyNo withUserAccouont:(NSString *)userAccount;
-(BOOL)deletePolicyCarData:(NSString *)strPolicyNo withUserAccount:(NSString *)userAccount;
-(NSMutableArray *)getPolicyCarData:(NSString *)strPolicyNo withUserAccount:(NSString *)userAccount;

-(BOOL)insertServiceNoticeData:(NSMutableArray *)arrServiceNoticeList withUserAccount:(NSString *)userAccount;
-(BOOL)deleteServiceNoticeData:(NSString *)strID withUserAccount:(NSString *)userAccount;
-(NSMutableArray *)getServiceNoticeData:(NSString *)userAccount;

-(BOOL)insertManufacturer:(NSMutableArray *)arrManufacturer;
-(BOOL)deleteManufacturer:(NSString *)strmanufacturerCode;
-(NSMutableArray *)getManufacturer;

-(BOOL)insertBrand:(NSMutableArray *)arrBrand withManufacturerCode:(NSString *)manufacturerCode;
-(BOOL)deleteBrand:(NSString *)strmanufacturerCode withBrandCode:(NSString *)strbrandCode;
-(NSMutableArray *)getBrand:(NSString *)strmanufacturerCode;
@end
